package com.jacky.ocr_plugin;

import android.content.Context;

import com.jacky.util.OcrLogger;

import java.util.HashMap;
import java.util.Map;

import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

/**
 * Created by liaoyacheng on 2021/9/13.
 */
public class OcrRectViewFactory extends PlatformViewFactory {

    BinaryMessenger binaryMessenger;

    public OcrRectViewFactory(BinaryMessenger binaryMessenger) {
        super(StandardMessageCodec.INSTANCE);
        this.binaryMessenger = binaryMessenger;
    }


    @Override
    public PlatformView create(Context context, int viewId, Object args) {
        HashMap<String,Object> params = null;
        if(args instanceof Map){
            params = (HashMap<String, Object>) args;
        }
        OcrLogger.d("tag","flutter to android, ocrPlugin OcrRectViewFactory create");
        return new OcrRectView(binaryMessenger,viewId,params);
    }
}
